home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / fbr12c / fbrunway.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-06  |  21.9 KB  |  706 lines

  1. VERSION 2.00
  2. Begin Form FBRunway 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "FileBoy's Runway 1.2c"
  6.    ClientHeight    =   1560
  7.    ClientLeft      =   1335
  8.    ClientTop       =   2730
  9.    ClientWidth     =   6675
  10.    FontBold        =   0   'False
  11.    FontItalic      =   0   'False
  12.    FontName        =   "MS Sans Serif"
  13.    FontSize        =   8.25
  14.    FontStrikethru  =   0   'False
  15.    FontUnderline   =   0   'False
  16.    ForeColor       =   &H00000000&
  17.    Height          =   2250
  18.    Icon            =   FBRUNWAY.FRX:0000
  19.    Left            =   1275
  20.    LinkMode        =   1  'Source
  21.    LinkTopic       =   "Form1"
  22.    MaxButton       =   0   'False
  23.    ScaleHeight     =   1560
  24.    ScaleWidth      =   6675
  25.    Top             =   2100
  26.    Width           =   6795
  27.    Begin ComboBox RunLine 
  28.       BackColor       =   &H00FFFFFF&
  29.       Height          =   300
  30.       Left            =   255
  31.       Sorted          =   -1  'True
  32.       TabIndex        =   0
  33.       Top             =   615
  34.       Width           =   6165
  35.    End
  36.    Begin CommandButton BtnClose 
  37.       Caption         =   "Close"
  38.       Height          =   360
  39.       Left            =   5325
  40.       TabIndex        =   5
  41.       Top             =   -15
  42.       Width           =   1365
  43.    End
  44.    Begin CommandButton BtnRun 
  45.       Caption         =   "Run"
  46.       Height          =   360
  47.       Left            =   3990
  48.       TabIndex        =   4
  49.       Top             =   -15
  50.       Width           =   1350
  51.    End
  52.    Begin CommandButton BtnSave 
  53.       Caption         =   "Save"
  54.       Height          =   360
  55.       Left            =   2655
  56.       TabIndex        =   3
  57.       Top             =   -15
  58.       Width           =   1350
  59.    End
  60.    Begin CommandButton BtnDel 
  61.       Caption         =   "Remove"
  62.       Height          =   360
  63.       Left            =   1320
  64.       TabIndex        =   2
  65.       Top             =   -15
  66.       Width           =   1350
  67.    End
  68.    Begin CommandButton BtnAdd 
  69.       Caption         =   "Add"
  70.       Height          =   360
  71.       Left            =   -15
  72.       TabIndex        =   1
  73.       Top             =   -15
  74.       Width           =   1350
  75.    End
  76.    Begin Label Label3 
  77.       Alignment       =   2  'Center
  78.       BackColor       =   &H00C0C0C0&
  79.       Caption         =   "On Use:"
  80.       FontBold        =   0   'False
  81.       FontItalic      =   0   'False
  82.       FontName        =   "MS Sans Serif"
  83.       FontSize        =   8.25
  84.       FontStrikethru  =   0   'False
  85.       FontUnderline   =   0   'False
  86.       ForeColor       =   &H00000080&
  87.       Height          =   210
  88.       Left            =   4860
  89.       TabIndex        =   8
  90.       Top             =   1170
  91.       Width           =   1665
  92.    End
  93.    Begin Label Label2 
  94.       Alignment       =   2  'Center
  95.       BackColor       =   &H00C0C0C0&
  96.       Caption         =   "Auto-Save:"
  97.       FontBold        =   0   'False
  98.       FontItalic      =   0   'False
  99.       FontName        =   "MS Sans Serif"
  100.       FontSize        =   8.25
  101.       FontStrikethru  =   0   'False
  102.       FontUnderline   =   0   'False
  103.       ForeColor       =   &H00000080&
  104.       Height          =   210
  105.       Left            =   3315
  106.       TabIndex        =   7
  107.       Top             =   1170
  108.       Width           =   1485
  109.    End
  110.    Begin Label Label1 
  111.       Alignment       =   2  'Center
  112.       BackColor       =   &H00C0C0C0&
  113.       Caption         =   "Run App:"
  114.       FontBold        =   0   'False
  115.       FontItalic      =   0   'False
  116.       FontName        =   "MS Sans Serif"
  117.       FontSize        =   8.25
  118.       FontStrikethru  =   0   'False
  119.       FontUnderline   =   0   'False
  120.       ForeColor       =   &H00000080&
  121.       Height          =   210
  122.       Left            =   150
  123.       TabIndex        =   6
  124.       Top             =   1170
  125.       Width           =   3105
  126.    End
  127.    Begin Menu MnuFile 
  128.       Caption         =   "&File"
  129.       Begin Menu MRun 
  130.          Caption         =   "&Run"
  131.          Shortcut        =   ^R
  132.       End
  133.       Begin Menu Sep1 
  134.          Caption         =   "-"
  135.       End
  136.       Begin Menu MAdd 
  137.          Caption         =   "&Add"
  138.          Shortcut        =   {F2}
  139.       End
  140.       Begin Menu MDel 
  141.          Caption         =   "Re&move"
  142.          Shortcut        =   {F3}
  143.       End
  144.       Begin Menu MSave 
  145.          Caption         =   "&Save"
  146.          Shortcut        =   ^S
  147.       End
  148.       Begin Menu Sep2 
  149.          Caption         =   "-"
  150.       End
  151.       Begin Menu MAss 
  152.          Caption         =   "Associate"
  153.          Shortcut        =   +{F9}
  154.       End
  155.       Begin Menu Sep3 
  156.          Caption         =   "-"
  157.       End
  158.       Begin Menu MClose 
  159.          Caption         =   "&Close"
  160.          Shortcut        =   ^C
  161.       End
  162.    End
  163.    Begin Menu MnuOption 
  164.       Caption         =   "&Options"
  165.       Begin Menu MnuRunApp 
  166.          Caption         =   "&Run App As..."
  167.          Begin Menu MOpt 
  168.             Caption         =   "&1 Normal"
  169.             Index           =   1
  170.             Shortcut        =   +{F1}
  171.          End
  172.          Begin Menu MOpt 
  173.             Caption         =   "&2 Minimized"
  174.             Index           =   2
  175.             Shortcut        =   +{F2}
  176.          End
  177.          Begin Menu MOpt 
  178.             Caption         =   "&3 Maximized"
  179.             Index           =   3
  180.             Shortcut        =   +{F3}
  181.          End
  182.          Begin Menu MOpt 
  183.             Caption         =   "&4 Normal w/o Focus"
  184.             Index           =   4
  185.             Shortcut        =   +{F4}
  186.          End
  187.          Begin Menu MOpt 
  188.             Caption         =   "&5 Minimized w/o Focus"
  189.             Index           =   7
  190.             Shortcut        =   +{F5}
  191.          End
  192.       End
  193.       Begin Menu Sep4 
  194.          Caption         =   "-"
  195.       End
  196.       Begin Menu MnuOnUse 
  197.          Caption         =   "Action On Use..."
  198.          Begin Menu MUse 
  199.             Caption         =   "&Close on Use"
  200.             Index           =   0
  201.             Shortcut        =   +{F6}
  202.          End
  203.          Begin Menu MUse 
  204.             Caption         =   "&Minimize"
  205.             Index           =   1
  206.             Shortcut        =   +{F7}
  207.          End
  208.          Begin Menu MUse 
  209.             Caption         =   "&Remain"
  210.             Index           =   2
  211.             Shortcut        =   +{F8}
  212.          End
  213.       End
  214.       Begin Menu Sep5 
  215.          Caption         =   "-"
  216.       End
  217.       Begin Menu MAuto 
  218.          Caption         =   "&Auto-Save on Close"
  219.          Checked         =   -1  'True
  220.          Shortcut        =   ^A
  221.       End
  222.    End
  223.    Begin Menu MnuHelp 
  224.       Caption         =   "&Help"
  225.       Begin Menu MHlp 
  226.          Caption         =   "&Index"
  227.          Shortcut        =   {F1}
  228.       End
  229.       Begin Menu MHlp1 
  230.          Caption         =   "&Help On Help"
  231.       End
  232.       Begin Menu Sep6 
  233.          Caption         =   "-"
  234.       End
  235.       Begin Menu MInfo 
  236.          Caption         =   "&About"
  237.       End
  238.    End
  239. DefInt A-Z
  240. Dim ListChg As Integer
  241. Declare Function WinExec Lib "Kernel" (ByVal lpCmdLine As String, ByVal nCmdShow As Integer) As Integer
  242. Declare Sub BringWindowToTop Lib "User" (ByVal hWnd As Integer)
  243. Declare Function GetModuleHandle% Lib "Kernel" (ByVal lpProgramName$)
  244. Declare Function GetModuleUsage% Lib "Kernel" (ByVal hProgram%)
  245. Declare Function GetPrivateProfileInt Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Integer, ByVal lpFileName As String) As Integer
  246. Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
  247. Declare Function WritePrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As Any, ByVal lplFileName As String) As Integer
  248. Declare Function GetClassWord Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer) As Integer
  249. Const GCW_HMODULE = (-16)
  250. Declare Function GetModuleFileName Lib "Kernel" (ByVal hModule As Integer, ByVal lpFileName As String, ByVal nSize As Integer) As Integer
  251. Declare Function WinHelp Lib "User" (ByVal hWnd As Integer, ByVal lpHelpFile As String, ByVal wCommand As Integer, dwData As Any) As Integer
  252. Const HQUIT = 2
  253. Const HINDEX = 3
  254. Const HHELP = 4
  255. Sub AddIt ()
  256.     NL$ = Chr$(13) + Chr$(10)
  257.     Tit$ = "Add Item Error"
  258.     If RunLine.Text = "" Then
  259.         Msg$ = "No application entered!"
  260.         Beep
  261.         MsgBox Msg$, 48, Tit$
  262.         RunLine.SetFocus
  263.         Exit Sub
  264.     End If
  265.     If RunLine.ListCount >= 50 Then
  266.         Msg$ = "Sorry!" + NL$ + NL$
  267.         Msg$ = Msg$ + "The applications list is already at" + NL$
  268.         Msg$ = Msg$ + "the maximum number allowed (50)." + NL$ + NL$
  269.         Msg$ = Msg$ + "You will have to delete one before" + NL$
  270.         Msg$ = Msg$ + "another can be added."
  271.         Beep
  272.         MsgBox Msg$, 48, Tit$
  273.         RunLine.SetFocus
  274.         Exit Sub
  275.     End If
  276.     Rline$ = LTrim$(RTrim$(RunLine.Text))
  277.     RunLine.AddItem Rline$
  278.     ListChg = True
  279.     RunLine.SetFocus
  280. End Sub
  281. Sub BtnAdd_Click ()
  282.     AddIt
  283. End Sub
  284. Sub BtnClose_Click ()
  285.     Closer
  286.     End
  287. End Sub
  288. Sub BtnDel_Click ()
  289.     DelIt
  290. End Sub
  291. Sub BtnRun_Click ()
  292.     Runner
  293. End Sub
  294. Sub BtnSave_Click ()
  295.     SendRunCfg
  296.     RunLine.SetFocus
  297. End Sub
  298. Sub Closer ()
  299.     NL$ = Chr$(13) + Chr$(10)
  300.     If MAuto.Checked = True Then SendRunCfg
  301.     If MAuto.Checked = False And ListChg = True Then
  302.         Msg$ = "Your Application List has changed." + NL$ + NL$
  303.         Msg$ = Msg$ + "Do you wish to save the changes?"
  304.         Tit$ = "Save Configuration?"
  305.         Beep
  306.         Res = MsgBox(Msg$, 52, Tit$)
  307.         If Res = 6 Then SendRunCfg
  308.     End If
  309.     Unload AboutIt
  310.     Unload Register
  311.     Unload RWAssoc
  312.     Fil$ = ""
  313.     Y = WinHelp(FBRunWay.hWnd, Fil$, HQUIT, ByVal 0&)
  314. End Sub
  315. Sub DelIt ()
  316.     NL$ = Chr$(13) + Chr$(10)
  317.     If RunLine.Text = "" Then
  318.         Msg$ = "No applications to remove!"
  319.         Tit$ = "Remove Item Error"
  320.         Beep
  321.         MsgBox Msg$, 48, Tit$
  322.         RunLine.SetFocus
  323.         Exit Sub
  324.     End If
  325.     Rlin = RunLine.ListIndex
  326.     If Rlin < 0 Then
  327.         Msg$ = "The application on the" + NL$
  328.         Msg$ = Msg$ + "command line has not" + NL$
  329.         Msg$ = Msg$ + "been added to the list."
  330.         Tit$ = "Application Delete Error"
  331.         Beep
  332.         MsgBox Msg$, 48, Tit$
  333.         RunLine.SetFocus
  334.         Exit Sub
  335.     End If
  336.     ListChg = True
  337.     RunLine.RemoveItem Rlin
  338.     RunLine.SetFocus
  339. End Sub
  340. Sub Form_Load ()
  341.     NL$ = Chr$(13) + Chr$(10)
  342.     ListChg = False
  343.     Hw% = GetModuleHandle("fbrunway.exe")
  344.     If GetModuleUsage(Hw%) > 1 Then
  345.         Msg$ = "Runway is already running!"
  346.         Tit$ = "FileBoy's Runway v. 1.2c"
  347.         Beep
  348.         MsgBox Msg$, 48, title$
  349.         Unload FBRunWay
  350.         End
  351.     End If
  352.     Register.Show 1
  353.     TheApp$ = "Runway"
  354.     X1 = (Screen.Width - FBRunWay.Width) / 2
  355.     Y1 = (Screen.Height - FBRunWay.Height) / 3
  356.     LPos = GetINIInt(TheApp$, "Left", X1)
  357.     TPos = GetINIInt(TheApp$, "Top", Y1)
  358.     FBRunWay.Left = LPos
  359.     FBRunWay.Top = TPos
  360.     Au = GetINIInt(TheApp$, "AutoSave", 0)
  361.     Select Case Au
  362.         Case 0
  363.             MAuto.Checked = False
  364.             Label2.Caption = "Auto-Save: Off"
  365.         Case 1
  366.             MAuto.Checked = True
  367.             Label2.Caption = "Auto-Save: On"
  368.     End Select
  369.     ZZ = GetINIInt(TheApp$, "RunApp", 1)
  370.     MOpt(ZZ).Checked = True
  371.     Beg$ = "Run App: "
  372.     Select Case ZZ
  373.         Case 1
  374.             Label1.Caption = Beg$ + "Normal with Focus"
  375.         Case 2
  376.             Label1.Caption = Beg$ + "Minimized with Focus"
  377.         Case 3
  378.             Label1.Caption = Beg$ + "Maximized"
  379.         Case 4
  380.             Label1.Caption = Beg$ + "Normal without Focus"
  381.         Case 7
  382.             Label1.Caption = Beg$ + "Minimized without Focus"
  383.     End Select
  384.     YY = GetINIInt(TheApp$, "ActOnUse", 0)
  385.     MUSe(YY).Checked = True
  386.     Beg$ = "On Use: "
  387.     Select Case YY
  388.         Case 0
  389.             Label3.Caption = Beg$ + "Close"
  390.         Case 1
  391.             Label3.Caption = Beg$ + "Minimize"
  392.         Case 2
  393.             Label3.Caption = Beg$ + "Remain"
  394.     End Select
  395.     PCnt = GetINIInt(TheApp$, "ProgCount", 0)
  396.     If PCnt = 0 Then GoTo Done
  397.     For X = 1 To PCnt
  398.         KeNm$ = "Program" + LTrim$(RTrim$(Str$(X)))
  399.         TheName$ = GetINIStr(TheApp$, KeNm$, "NONE")
  400.         TheName$ = LTrim$(RTrim$(TheName$))
  401.         If TheName$ = "NONE" Then Exit For
  402.         RunLine.AddItem TheName$
  403.     Next X
  404. Done:
  405. End Sub
  406. Sub Form_Paint ()
  407.     FrameBarFrm FBRunWay, BtnAdd
  408.     FrameCtrl FBRunWay, RunLine, RunLine, RunLine, RunLine
  409.     FrameLeftStat FBRunWay, Label1
  410.     FrameMidStat FBRunWay, Label2
  411.     FrameRightStat FBRunWay, Label3
  412. End Sub
  413. Sub Form_Resize ()
  414.     Select Case FBRunWay.WindowState
  415.         Case 0
  416.             RunLine.SetFocus
  417.             FBRunWay.Caption = "FileBoy's Runway 1.2c"
  418.         Case 1
  419.             FBRunWay.Caption = "Runway 1.2c"
  420.     End Select
  421. End Sub
  422. Sub Form_Unload (Cancel As Integer)
  423.     Closer
  424. End Sub
  425. Sub GetHelp (HType As Integer)
  426.     Select Case HType
  427.         Case HINDEX
  428.             Fil$ = String$(255, 0)
  429.             hModule = GetClassWord(FBRunWay.hWnd, GCW_HMODULE)
  430.             FLength& = GetModuleFileName(hModule, Fil$, 255)
  431.             Fil$ = LTrim$(RTrim$(Left$(Fil$, FLength& - 12)))
  432.             Fil$ = Fil$ + LTrim$(RTrim$("fbrunway.hlp"))
  433.             X = WinHelp(FBRunWay.hWnd, Fil$, HINDEX, ByVal 0&)
  434.         Case HHELP
  435.             Fil$ = ""
  436.             Z = WinHelp(FBRunWay.hWnd, Fil$, HHELP, ByVal 0&)
  437.     End Select
  438.     Fil$ = ""
  439. End Sub
  440. Function GetINIInt (App As String, Key As String, KeyDef As Integer) As Integer
  441.     File$ = "FILEBOY.INI"
  442.     App = LTrim$(RTrim$(App))
  443.     Key = LTrim$(RTrim$(Key))
  444.     GetINIInt = GetPrivateProfileInt(App, Key, KeyDef, File$)
  445. End Function
  446. Function GetINIStr (App As String, Key As String, Def As String) As String
  447.     File$ = "fileboy.ini"
  448.     App = LTrim$(RTrim$(App))
  449.     Key = LTrim$(RTrim$(Key))
  450.     Def = LTrim$(RTrim$(Def))
  451.     Hold$ = String$(255, 0)
  452.     ZZZ = GetPrivateProfileString(App, Key, Def, Hold$, 255, File$)
  453.     Hold$ = LTrim$(RTrim$(Left$(Hold$, ZZZ)))
  454.     GetINIStr = Hold$
  455.     Hold$ = ""
  456. End Function
  457. Sub MAdd_Click ()
  458.     AddIt
  459. End Sub
  460. Sub MAss_Click ()
  461.     RWAssoc.Show 1
  462. End Sub
  463. Sub MAuto_Click ()
  464.     If MAuto.Checked = False Then
  465.         MAuto.Checked = True
  466.         Label2.Caption = "Auto-Save: On"
  467.     Else
  468.         MAuto.Checked = False
  469.         Label2.Caption = "Auto-Save: Off"
  470.     End If
  471. End Sub
  472. Sub MClose_Click ()
  473.     Closer
  474.     Unload AboutIt
  475.     Unload Register
  476.     End
  477. End Sub
  478. Sub MDel_Click ()
  479.     DelIt
  480. End Sub
  481. Sub MHlp_Click ()
  482.     GetHelp (HINDEX)
  483. End Sub
  484. Sub MHlp1_Click ()
  485.     GetHelp (HHELP)
  486. End Sub
  487. Sub MInfo_Click ()
  488.     AboutIt.Show 1
  489.     RunLine.SetFocus
  490. End Sub
  491. Sub MOpt_Click (Index As Integer)
  492.     MOpt(Index).Checked = True
  493.     For X = 1 To 4
  494.         If X <> Index Then MOpt(X).Checked = False
  495.     Next X
  496.     If Index <> 7 Then MOpt(7).Checked = False
  497.     Beg$ = "Run App: "
  498.     Select Case Index
  499.         Case 1
  500.             Label1.Caption = Beg$ + "Normal with Focus"
  501.         Case 2
  502.             Label1.Caption = Beg$ + "Minimized with Focus"
  503.         Case 3
  504.             Label1.Caption = Beg$ + "Maximized"
  505.         Case 4
  506.             Label1.Caption = Beg$ + "Normal without Focus"
  507.         Case 7
  508.             Label1.Caption = Beg$ + "Minimized without Focus"
  509.     End Select
  510. End Sub
  511. Sub MRun_Click ()
  512.     Runner
  513. End Sub
  514. Sub MSave_Click ()
  515.     SendRunCfg
  516.     RunLine.SetFocus
  517. End Sub
  518. Sub MUse_Click (Index As Integer)
  519.     Beg$ = "On Use: "
  520.     Select Case Index
  521.         Case 0
  522.             MUSe(0).Checked = True
  523.             MUSe(1).Checked = False
  524.             MUSe(2).Checked = False
  525.             Label3.Caption = Beg$ + "Close"
  526.         Case 1
  527.             MUSe(1).Checked = True
  528.             MUSe(0).Checked = False
  529.             MUSe(2).Checked = False
  530.             Label3.Caption = Beg$ + "Minimize"
  531.         Case 2
  532.             MUSe(2).Checked = True
  533.             MUSe(0).Checked = False
  534.             MUSe(1).Checked = False
  535.             Label3.Caption = Beg$ + "Remain"
  536.     End Select
  537. End Sub
  538. Function PutINI (App As String, Key As String, KeyVal As String) As Integer
  539.     File$ = "FILEBOY.INI"
  540.     App = LTrim$(RTrim$(App))
  541.     Key = LTrim$(RTrim$(Key))
  542.     KeyVal = LTrim$(RTrim$(KeyVal))
  543.     If Len(KeyVal) Then
  544.         XYZ = WritePrivateProfileString(App$, Key$, ByVal KeyVal$, File$)
  545.     Else
  546.         XYZ = WritePrivateProfileString(App$, Key$, ByVal 0&, File$)
  547.     End If
  548.     Select Case XYZ
  549.         Case 0
  550.             PutINI = False
  551.         Case Else
  552.             PutINI = True
  553.     End Select
  554. End Function
  555. Sub RunLine_KeyPress (KeyAscii As Integer)
  556.     If KeyAscii = (13) Then Runner
  557. End Sub
  558. Sub Runner ()
  559.     NL$ = Chr$(13) + Chr$(10)
  560.     title$ = "Runway!"
  561.     App$ = LTrim$(RTrim$(RunLine.Text))
  562.     If App$ = "" Then
  563.         Msg$ = "Pilot Error!" + NL$ + NL$ + "You must first enter/place an" + NL$
  564.         Msg$ = Msg$ + "application or file on the Runline." + NL$
  565.         Beep
  566.         MsgBox Msg$, 48, title$
  567.         RunLine.SetFocus
  568.         Exit Sub
  569.     End If
  570.     Spa$ = (" ")
  571.     Pos = InStr(1, App$, Spa$)
  572.     If Pos = 0 Then
  573.         Dot$ = "."
  574.         Pos1 = InStr(1, App$, Dot$)
  575.         If Pos1 > 1 Then
  576.             Ext$ = Right$(App$, Len(App$) - Pos1)
  577.             If Ext$ <> "exe" And Ext$ <> "com" And Ext$ <> "bat" And Ext$ <> "pif" Then
  578.                 Tmp$ = LTrim$(RTrim$(GetWinStr("extensions", Ext$, "")))
  579.                 If Len(Tmp$) Then
  580.                     Pos = InStr(1, Tmp$, Chr$(32))
  581.                     Tmp$ = Left$(Tmp$, Pos - 1)
  582.                     App$ = Tmp$ + Chr$(32) + App$
  583.                 Else
  584.                     Msg$ = "No programs are associated with this file."
  585.                     MsgBox Msg$, 48
  586.                     Exit Sub
  587.                 End If
  588.             End If
  589.         End If
  590.     End If
  591.     Hw = GetModuleHandle(App$)
  592.     If GetModuleUsage(Hw) >= 1 Then
  593.         Msg$ = "The application" + NL$ + NL$ + UCase$(App$) + NL$ + NL$
  594.         Msg$ = Msg$ + "is already running!  Do you" + NL$
  595.         Msg$ = Msg$ + "want to try to run another" + NL$
  596.         Msg$ = Msg$ + "instance of the program?" + NL$ + NL$
  597.         Msg$ = Msg$ + "(Not all programs allow this.)" + NL$
  598.         Beep
  599.         Res% = MsgBox(Msg$, 292, title$)
  600.         Select Case Res%
  601.             Case 6
  602.                 GoTo DoIt
  603.             Case 7
  604.                 RunLine.SetFocus
  605.                 GoTo GetOut
  606.         End Select
  607.     End If
  608. DoIt:
  609.     Select Case True
  610.         Case MOpt(1).Checked
  611.             Zx = 1
  612.         Case MOpt(2).Checked
  613.             Zx = 2
  614.         Case MOpt(3).Checked
  615.             Zx = 3
  616.         Case MOpt(4).Checked
  617.             Zx = 4
  618.         Case MOpt(7).Checked
  619.             Zx = 7
  620.     End Select
  621.     Select Case True
  622.         Case MUSe(1).Checked
  623.             RunLine.SetFocus
  624.             FBRunWay.WindowState = 1
  625.         Case MUSe(2).Checked
  626.             RunLine.SetFocus
  627.     End Select
  628.     On Error Resume Next
  629.     If WinExec(App$, Zx) < 32 Then
  630.         Msg$ = "Error!" + NL$ + NL$ + "Unable to run/load the application." + NL$ + NL$
  631.         Msg$ = Msg$ + UCase$(App$) + NL$ + NL$ + "Make sure the [path]\filename was" + NL$
  632.         Msg$ = Msg$ + "entered correctly and try again." + NL$
  633.         Beep
  634.         MsgBox Msg$, 16, title$
  635.         RunLine.SetFocus
  636.         Exit Sub
  637.     End If
  638.     If MUSe(0).Checked = True Then
  639.         Unload AboutIt
  640.         Unload Register
  641.         Closer
  642.         End
  643.     End If
  644.     If MUSe(2).Checked = True And MOpt(4).Checked = True Then
  645.         BringWindowToTop (FBRunWay.hWnd)
  646.     End If
  647. GetOut:
  648. End Sub
  649. Sub SendRunCfg ()
  650.     NL$ = Chr$(13) + Chr$(10)
  651.     Msg$ = "Unable to save the settings for" + NL$ + NL$
  652.     Tit$ = "Write ERROR!"
  653.     AName$ = "Runway"
  654.     X1 = FBRunWay.Left
  655.     Stat = PutINI(AName$, "Left", Str$(X1))
  656.     Y1 = FBRunWay.Top
  657.     Stat = PutINI(AName$, "Top", Str$(Y1))
  658.     If Stat = False Then Msg$ = Msg$ + "Screen Position" + NL$
  659.     Stat1 = PutINI(AName$, "AutoSave", Str$(Abs(MAuto.Checked)))
  660.     If Stat1 = False Then Msg$ = Msg$ + "Auto-Save On Close" + NL$
  661.     Select Case True
  662.         Case MOpt(1).Checked
  663.             KVl$ = Str$(1)
  664.         Case MOpt(2).Checked
  665.             KVl$ = Str$(2)
  666.         Case MOpt(3).Checked
  667.             KVl$ = Str$(3)
  668.         Case MOpt(4).Checked
  669.             KVl$ = Str$(4)
  670.         Case MOpt(7).Checked
  671.             KVl$ = Str$(7)
  672.     End Select
  673.     Stat2 = PutINI(AName$, "RunApp", KVl$)
  674.     If Stat2 = False Then Msg$ = Msg$ + "Run On Start-Up" + NL$
  675.     For X = 0 To 2
  676.         If MUSe(X).Checked Then KVl$ = Str$(X)
  677.     Next X
  678.     Stat3 = PutINI(AName$, "ActOnUse", KVl$)
  679.     If Stat3 = False Then Msg$ = Msg$ + "Action On Use" + NL$
  680.     OldNum = GetINIInt(AName$, "ProgCount", 0)
  681.     NewNum = RunLine.ListCount
  682.     If OldNum > NewNum Then
  683.         For cc = (NewNum + 1) To OldNum
  684.             KNm$ = "Program" + LTrim$(RTrim$(Str$(cc)))
  685.             Duh = PutINI(AName$, KNm$, "")
  686.         Next
  687.     End If
  688.     Stat4 = PutINI(AName$, "ProgCount", Str$(NewNum))
  689.     If Stat4 = False Then Msg$ = Msg$ + "ProgCount" + NL$
  690.     For X = 1 To NewNum
  691.         KNm$ = "Program" + LTrim$(RTrim$(Str$(X)))
  692.         KVl$ = RunLine.list(X - 1)
  693.         Stat5 = PutINI(AName$, KNm$, KVl$)
  694.         If Stat5 = False Then Msg$ = Msg$ + KNm$ + NL$
  695.     Next X
  696.     If NewNum = 0 Then Stat5 = True
  697.     Msg$ = Msg$ + NL$ + "Please make sure that the" + NL$
  698.     Msg$ = Msg$ + "FILEBOY.INI file is in" + NL$
  699.     Msg$ = Msg$ + "your Windows directory."
  700.     If Stat1 = False Or Stat2 = False Or Stat3 = False Or Stat4 = False Or Stat5 = False Then
  701.          Beep
  702.          MsgBox Msg$, 16, Tit$
  703.     End If
  704.     ListChg = False
  705. End Sub
  706.